// eslint-disable-next-line
import { UserLayout, BasicLayout, RouteView, PageView, GeneralView, MonitorView } from '@/components/layouts'

export const asyncRouterMap = [
  {
    path: '/',
    name: 'Index',
    component: BasicLayout,
    meta: {
      title: '首页'
    },
    redirect: 'workplace',
    children: [
      {
        path: 'workplace',
        name: 'Workplace',
        component: () => import(/* webpackChunkName: "workplace" */ '@/views/dashboard/Workplace')
      },
      // 业务代码
      {
        path: 'neuray',
        name: 'neuray',
        component: PageView,
        children: [
          {
            path: 'staff-list',
            name: 'staffmdList',
            component: () => import(/* webpackChunkName: "roleList" */ '@/views/admin/staff/staff.vue'),
            meta: {
              title: '员工信息'
            }
          },
          {
            path: 'generatormd-list',
            name: 'generatormdList',
            component: () => import(/* webpackChunkName: "roleList" */ '@/views/generate/generation.vue'),
            meta: {
              title: '生成代码'
            }
          },
          {
            path: 'generatorfile-list',
            name: 'generatorfileList',
            component: () => import(/* webpackChunkName: "roleList" */ '@/views/generate/codefile.vue'),
            meta: {
              title: '代码生成列表'
            }
          },
          {
            path: 'prjInfo-list',
            name: 'prjInfoList',
            component: () => import(/* webpackChunkName: "roleList" */ '@/views/generate/projectinfo.vue'),
            meta: {
              title: '项目信息'
            }
          },
          {
            path: 'dbconfig-list',
            name: 'dbconfigList',
            component: () => import(/* webpackChunkName: "dbconfig" */ '@/views/generate/dbconfig.vue'),
            meta: {
              title: '数据库配置'
            }
          },
          {
            path: 'serverconfig-list',
            name: 'serverconfigList',
            component: () => import(/* webpackChunkName: "serverconfig" */ '@/views/generate/serverconfig.vue'),
            meta: {
              title: '配置信息'
            }
          },
          {
            path: 'user-list',
            name: 'UserList',
            component: () => import(/* webpackChunkName: "userList" */ '@/views/admin/UserList'),
            meta: {
              title: '用户管理'
            }
          },
          {
            path: 'user-edit',
            name: 'UserEdit',
            component: () => import('@/views/admin/UserEdit'),
            meta: {
              title: '用户编辑'
            }
          },
          {
            path: 'org-list',
            name: 'OrgList',
            component: () => import(/* webpackChunkName: "orgList" */ '@/views/admin/OrgList'),
            meta: {
              title: '组织管理'
            }
          },
          {
            path: 'role-list',
            name: 'RoleList',
            component: () => import(/* webpackChunkName: "roleList" */ '@/views/admin/RoleList'),
            meta: {
              title: '角色管理'
            }
          },
          {
            path: 'menu-list',
            name: 'MenuList',
            component: () => import(/* webpackChunkName: "menuList" */ '@/views/admin/MenuList'),
            meta: {
              title: '菜单管理'
            }
          },
          {
            path: 'ribs-list',
            name: 'ribs',
            component: () => import(/* webpackChunkName: "ribs" */ '@/views/wb/ribs/ribs.vue'),
            meta: {
              title: '报销列表查询'
            }
          },
          {
            path: 'ribs-approve',
            name: 'ribsapprove',
            component: () => import(/* webpackChunkName: "ribsApprove" */ '@/views/wb/ribs/ribsApprove.vue'),
            meta: {
              title: '报销审批'
            }
          }
        ]
      },
      {
        path: 'exception',
        name: 'Exception',
        component: RouteView,
        redirect: '/exception/403',
        meta: {
          title: '异常页',
          icon: 'warning',
          permission: ['exception']
        },
        children: [
          {
            path: '403',
            name: 'Exception403',
            component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
            meta: {
              title: '403',
              permission: ['exception']
            }
          },
          // {
          //   path: '404',
          //   name: 'Exception4041',
          //   component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
          //   meta: {
          //     title: '404',
          //     permission: ['exception']
          //   }
          // },
          {
            path: '500',
            name: 'Exception500',
            component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
            meta: {
              title: '500',
              permission: ['exception']
            }
          }
        ]
      },
      // account
      {
        path: 'account',
        component: GeneralView,
        redirect: '/account/center',
        name: 'Account',
        hidden: true,
        meta: {
          title: '个人页',
          icon: 'user',
          keepAlive: true,
          permission: ['self']
        },
        children: [
          {
            path: 'center',
            name: 'Center',
            component: () => import(/* webpackChunkName: "account-center" */ '@/views/account/center/Index'),
            meta: {
              title: '个人中心',
              keepAlive: true,
              permission: ['self']
            }
          },
          {
            path: 'settings',
            name: 'Settings',
            component: () => import(/* webpackChunkName: "account-settings" */ '@/views/account/settings/Index'),
            meta: {
              title: '个人设置',
              hideHeader: true,
              keepAlive: true,
              permission: ['self']
            },
            redirect: '/account/settings/base',
            hideChildrenInMenu: true,
            children: [
              {
                path: 'base',
                name: 'BaseSettings',
                component: () =>
                  import(/* webpackChunkName: "account-settings" */ '@/views/account/settings/BaseSetting'),
                meta: {
                  title: '基本设置',
                  hidden: true,
                  keepAlive: false,
                  permission: ['self']
                }
              },
              {
                path: 'custom',
                name: 'CustomSettings',
                component: () => import(/* webpackChunkName: "account-settings" */ '@/views/account/settings/Custom'),
                meta: {
                  title: '个性化设置',
                  hidden: true,
                  keepAlive: false,
                  permission: ['self']
                }
              },
              {
                path: 'change',
                name: 'ChangePassword',
                component: () => import(/* webpackChunkName: "account-settings" */ '@/views/account/settings/ChangePassword'),
                meta: {
                  title: '修改密码',
                  hidden: true,
                  keepAlive: false,
                  permission: ['self']
                }
              }
            ]
          }
        ]
      }

    ]
  }
  // {
  //   path: '*',
  //   redirect: '/404',
  //   hidden: true
  // }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/gatelogin',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'Login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  },
  // app
  // 路由名称以app开头，通过微信校验身份
  {
    path: '/app',
    component: BasicLayout,
    hidden: true,
    children: [
      {
        path: 'addressList',
        name: 'appAddressList',
        component: () => import(/* webpackChunkName: "addressList" */ '@/views/app/AddressList.vue')
      },
      {
        path: 'expense-index',
        name: 'appExpenseIndex',
        component: () => import(/* webpackChunkName: "ExpenseAccount" */ '@/views/app/expense/menu.vue')
      },
      {
        path: 'fillin-main',
        name: 'appFillinMain',
        component: () => import(/* webpackChunkName: "ExpenseAccount" */ '@/views/app/expense/fillin_main.vue')
      },
      {
        path: 'history-main',
        name: 'appHistoryMain',
        component: () => import(/* webpackChunkName: "ExpenseAccount" */ '@/views/app/expense/history_main.vue'),
        meta: {
          keepAlive: true // 此组件需要被缓存
        }
      }
    ]
  }
]
